package com.tl.satoken.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tl.satoken.domain.entity.Hero;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

public interface HeroMapper extends BaseMapper<Hero> {

    @Select("SELECT u.id as userId FROM hero h " +
            "INNER JOIN users u ON h.user_id = u.id " +
            "WHERE h.id = #{heroId}")
    Long findUserIdByHeroId(@Param("heroId") Integer heroId);
}
